package com.roosterrobotics.replicant.provider;

import android.net.Uri;
import android.provider.BaseColumns;

public class ReplicantData {
	public static final int COMMUNITY_ID_COLUMN = 0;
	public static final int COMMUNITY_NAME_COLUMN = 1;
	
	public static final String AUTHORITY = "com.roosterrobotics.replicant.provider";
	
	public static final class Communities implements BaseColumns {
		
		private Communities(){}
		
		public static final String DEFAULT_SORT_ORDER = "name ASC";
		
		public static final Uri COMMUNITIES_URI = Uri.parse("content://" + AUTHORITY + "/" 
				+ Communities.COMMUNITY_NAME);
		
		public static final Uri CONTENT_URI = COMMUNITIES_URI;
		
		// The community table MimeType
		public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.com.roosterrobotics.replicant.provider.community";
		
		//A community's row MimeType
		public static final String CONTENT_COMMUNITY_TYPE = "vnd.android.cursor.item/vnd.com.roosterrobotics.replicant.provider.community";
		
		/*******************************************************
		 * The community itself.
		 * 
		 */
		public static final String COMMUNITY_NAME = "community";
		
		/******************************************************
		 * The name of the name column.
		 */
		public static final String COMMUNITY_NAME_COLUMN_NAME = "name";
		
		/******************************************************
		 * The name of the id column.
		 * 
		 */
		public static final String COMMUNITY_ID_COLUMN_NAME = "_id";
	}
	
	public static final class Devices implements BaseColumns {
		private Devices() {};
		
		public static final String DEFAULT_SORT_ORDER = "name ASC";
		
		public static final Uri DEVICES_URI = Uri.parse("content://" + AUTHORITY + "/" 
				+ Devices.DEVICE_NAME);
		
		public static final Uri CONTENT_URI = DEVICES_URI;
		
		// The device table MimeType
		public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.com.roosterrobotics.replicant.provider.device";
		
		//A device's row MimeType
		public static final String CONTENT_DEVICE_TYPE = "vnd.android.cursor.item/vnd.com.roosterrobotics.replicant.provider.device";
		
		/*******************************************************
		 * The device itself.
		 * 
		 */
		public static final String DEVICE_NAME = "device";
		
		/******************************************************
		 * The name of the name column.
		 */
		public static final String DEVICE_NAME_COLUMN_NAME = "name";
		
		/******************************************************
		 * The name of the id column.
		 * 
		 */
		public static final String DEVICE_ID_COLUMN_NAME = "_id";
		
		
		/******************************************************
		 * The name of the address column.
		 */
		public static final String DEVICE_ADDRESS_COLUMN_NAME = "address";
		
		/******************************************************
		 * The name of the port column.
		 */
		public static final String DEVICE_PORT_COLUMN_NAME = "port";
		
		/******************************************************
		 * The name of the lock column.
		 */
		public static final String DEVICE_LOCK_COLUMN_NAME = "lock";
		
		/******************************************************
		 * The name of the replicant column.
		 */
		public static final String DEVICE_REPLICANT_COLUMN_NAME = "replicant";
		
		/******************************************************
		 * The name of the id column.
		 * 
		 */
		public static final String DEVICE_COMMUNITY_COLUMN_NAME = "community";
		
	}
	
	public static final class Actuators implements BaseColumns {
		private Actuators() {};
		
		public static final String DEFAULT_SORT_ORDER = "name ASC";
		
		public static final Uri ACTUATORS_URI = Uri.parse("content://" + AUTHORITY + "/" 
				+ Actuators.ACTUATOR_NAME);
		
		public static final Uri CONTENT_URI = ACTUATORS_URI;
		
		// The sensor table MimeType
		public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.com.roosterrobotics.replicant.provider.actuator";
		
		//A sensor's row MimeType
		public static final String CONTENT_ACTUATOR_TYPE = "vnd.android.cursor.item/vnd.com.roosterrobotics.replicant.provider.actuator";
		
		/*******************************************************
		 * The actuator itself.
		 * 
		 */
		public static final String ACTUATOR_NAME = "actuator";
		
		/******************************************************
		 * The name of the name column.
		 */
		public static final String ACTUATOR_NAME_COLUMN_NAME = "name";
		
		/******************************************************
		 * The name of the id column.
		 * 
		 */
		public static final String ACTUATOR_ID_COLUMN_NAME = "_id";
		
		/******************************************************
		 * The name of min_value column.
		 * 
		 */
		public static final String ACTUATOR_MINVALUE = "min_value";
		
		/******************************************************
		 * The name of max_value column.
		 * 
		 */
		public static final String ACTUATOR_MAXVALUE = "max_value";
		
		
		
		/******************************************************
		 * The name of the feedback column.
		 * 
		 */
		public static final String ACTUATOR_FEEDBACK_COLUMN_NAME = "feedback";

		/******************************************************
		 * The name of the device fk column.
		 * 
		 */
		public static final String ACTUATOR_DEVICE_COLUMN_NAME = "device";
		
		/******************************************************
		 * The name of the internal id column.
		 * 
		 */
		public static final String ACTUATOR_INTERNAL_ID_COLUMN_NAME = "int_id";

	}
	
	
	public static final class Sensors implements BaseColumns {
		private Sensors() {};
		
		public static final String DEFAULT_SORT_ORDER = "name ASC";
		
		public static final Uri SENSORS_URI = Uri.parse("content://" + AUTHORITY + "/" 
				+ Sensors.SENSOR_NAME);
		
		public static final Uri CONTENT_URI = SENSORS_URI;
		
		// The sensor table MimeType
		public static final String CONTENT_TYPE = "vnd.android.cursor.dir/vnd.com.roosterrobotics.replicant.provider.sensor";
		
		//A sensor's row MimeType
		public static final String CONTENT_SENSOR_TYPE = "vnd.android.cursor.item/vnd.com.roosterrobotics.replicant.provider.sensor";
		
		/*******************************************************
		 * The device itself.
		 * 
		 */
		public static final String SENSOR_NAME = "sensor";
		
		/******************************************************
		 * The name of the name column.
		 */
		public static final String SENSOR_NAME_COLUMN_NAME = "name";
		
		/******************************************************
		 * The name of the id column.
		 * 
		 */
		public static final String SENSOR_ID_COLUMN_NAME = "_id";
		
		/******************************************************
		 * The name of the units column
		 * 
		 */
		public static final String SENSOR_UNITS_COLUMN_NAME = "units";
		
		/******************************************************
		 * The name of the isDigital column.
		 * 
		 */
		public static final String SENSOR_ISDIGITAL_COLUMN_NAME = "digital";

		/******************************************************
		 * The name of the device fk column.
		 * 
		 */
		public static final String SENSOR_DEVICE_COLUMN_NAME = "device";
		
		/******************************************************
		 * The name of the internal id column.
		 * 
		 */
		public static final String SENSOR_INTERNAL_ID_COLUMN_NAME = "int_id";

	}


}
